import React from 'react'
import {Link} from 'react-router-dom'

import './style.scss'

class Item extends React.Component{
    constructor(props){
        super(props)
    }
    render() {
        const data = this.props.data
        return (
            <div className="list-item clearfix">
                <Link to={'/detail/'+ data.id}>
                    <div className="left fl">
                        <img src={data.img}/>
                    </div>
                    <div className="right fr">
                        <div className="r-top">
                            <span className="titile fl">{data.titile}</span>
                            <span className="distence fr">{data.distence}</span>
                        </div>
                        <div className="r-middle">
                            <p>{data.subTitle}</p>
                        </div>
                        <div className='r-bottom'>
                            <span className="price">
                                <i>￥</i>
                                {data.price}
                            </span>
                            <span className="number fr">{data.number}</span>
                        </div>
                    </div>
                </Link>
            </div>
        )
    }
    componentDidMount() {
        // console.log(this.props.data)
    }
}

export default Item